﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="js/jquery.js"></script>
    <script src="javascript/jquery.zclip.min.js"></script>
    <script type="text/javascript">
        $(function() {
            $('#copy-button').zclip({
                path: 'javascript/ZeroClipboard.swf',
                copy: $('#content').text()
            });

            // 当点击 Id 为 copy-button 的按钮时
            // Id 为 content 中的内容将会被复制

            $('#copy-dynamic').zclip({
                path: 'javascript/ZeroClipboard.swf',
                copy: function () {
                    return $('#dynamic').val();
                }
            });

        });
    </script>
</head>
<body>
    <div id="content">http://www.sunzhenghua.com/blog</div>
<button id="copy-button">点击复制该链接</button>
 
//动态
<input type="text" id="dynamic" value="http://www.mostupdated.com" />
<button id="copy-dynamic">复制 input 框中的内容</button>
</body>
</html>
